<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
    <title>Document</title>
</head>

<body>
    <!-- 用jsonp实现跨域 -->
    <script>
        $.ajax({
            type: "method",//这个端口不允许跨域访问
            url: "",
            dataType: "jsonp",//写json不行,用jsonp就可以了
            jsonp: "callback",
            success: function (data) {
            },
            error: function (xhr) {
                console.log(xhr.status)
            }
        })
    </script>
</body>

</html>